package org.edu.service.impl;

import java.util.List;

import org.edu.dao.SemesterDao;
import org.edu.model.Semester;
import org.edu.service.SemesterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("semesterService")
public class SemesterServiceImpl implements SemesterService {

	@Autowired
	private SemesterDao semesterDao;

	public SemesterServiceImpl() {
	}

	@Transactional
	public void save(Semester semester) throws Exception {
		semesterDao.save(semester);
	}

	@Transactional
	public void update(Semester semester) throws Exception {
		semesterDao.update(semester);
	}

	@Transactional
	public void remove(Semester semester) throws Exception {
		semesterDao.remove(semester);
	}

	@Transactional(readOnly = true)
	public List<Semester> semesters() {
		return semesterDao.semesters();
	}

	@Transactional
	public Semester findById(Long semester_id) throws Exception {
		return semesterDao.findById(semester_id);
	}

}
